package com.wonder.dto;

public class Sushu {

    public static int eratosthenes(int n) {
        boolean[] isPrime = new boolean[n];
        int count = 0;
        for (int i = 2; i < n ; i++){
            if (isPrime[i]){
                continue;
            }

            for (int j = i * i; j < n;j+=i){
                isPrime[j] = true;
            }

            count++;
        }

        return count;
    }

    public static void main(String[] args) {
        System.out.printf("n = " + eratosthenes(100));
    }
}
